import React from 'react';
import { Route } from 'react-router';
import { WeaLocaleProvider } from 'ecCom';

import Home from './components/Home';
// import CollectionSend from './components/CollectionSend'
// import CollectionReceive from './components/CollectionReceive'
import ReceiveDoc from './components/ReceiveDoc';
import SendDoc from './components/SendDoc';
import TodoComponent from './components/TodoComponent';
import NewTodoComp from './components/NewTodoComp';
import ToViewComponent from './components/ToViewComponent';
import ToViedComponent from './components/ToViedComponent';
import OdocLibraryComponent from './components/OdocLibraryComponent';
import SearchReqComponent from './components/SearchReqComponent';
import AccountListComponent from './components/AccountListComponent';
import ReportComponent from './components/report/ReportComponent';
import CenterComponent from './components/center';
import OnlineEdit from './components/onlineEdit/index';
// import Test from './components/Test';
import privateGroupSetingComponent from './components/privateGroupSetingComponent';
import UploadFileComponent from './components/UploadFileComponent';
import DocVersionComponent from './components/docWorkflow/DocVersionComponent'; 
import RecPostDocUnitComponent from './components/docWorkflow/RecPostDocUnitComponent';
import OpenModelCompenent from './components/docWorkflow/OpenModelCompenent';
import DocTemplateComponent from './components/docWorkflow/DocTemplateComponent';
import OdocSignGroupPageComponent from './components/docWorkflow/OdocSignGroupPageComponent';
import OdocFinish from './components/odocFinish';
import OdocDoneComponent from './components/doComponent';
import AddOdocRequest from './components/add/AddOdocRequest';
import ReceiveDocManageComp from './components/ReceiveDocManageComp';
import SendDocManageComp from './components/SendDocManageComp';
import SignDocManageComp from './components/SignDocManageComp';
import OdocLibraryNewComponent from './components/OdocLibraryNewComponent';
import TrackingWorkflowComp from './components/TrackingWorkflowComp';
import SuperviseComponent from './components/SuperviseComponent';
import CustomTableComp from './components/customTablePage/CustomTableComp';
import PortalElement from './components/portalElement';
import QuickEntryElementComp from './components/portalElement/QuickEntryElementComp';
import OdocTypeDialogCom from './components/OdocTypeChangeDialog';// 流程表单页面文种变更弹窗
import OdocSignApproval from './components/odocSignApproval';// 签批
// 公文报表查分出来的小组件
import FlowChartComponent from './components/report/FlowChartComponent';
import OdocCountEchartsComp from './components/report/OdocCountEchartsComp';
import ReceiveDocRegistComp from './components/ReceiveDocRegistComp';
import UploadDocFile from './components/docWorkflow/UploadDocFileComponent';
import ProgressComponent from "./components/progressComp";
import OfdNumberListCom from "./components/OfdNumberListCom";

// 公文中心拆分出来的小组件
import LayoutLeftTopComp from './components/center/LayoutLeftTopComp';
import LayoutLeftOdocTypeComp from './components/center/LayoutLeftOdocTypeComp';
import LayoutLeftTopicTypeComp from './components/center/LayoutLeftTopicTypeComp';
import LayoutRightSearchComp from './components/center/LayoutRightSearchComp';
import LayoutRightLibraryComp from './components/center/LayoutRightLibraryComp';
import LayoutRightTodoComp from './components/center/LayoutRightTodoComp';
import LayoutRightToViewComp from './components/center/LayoutRightToViewComp';
// 公文门户组件
import OdocPortalOdocWFComp from './components/OdocPortalOdocWFComp';
import OdocPortalOdocLibComp from './components/OdocPortalOdocLibComp';

import OdocPrintMould from './components/odocPrintMould';
import OdocComps2Export from './components/OdocComps2Export';
import * as OdocComsDialogTypes from './constants/OdocCompsDialogType';
import OdocEvent from './util/OdocEvent4Export';

import './style';
import stores from './stores';
import * as exportsComp from './util/importComps';

const getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, 'odoc');

const Routes = (
  <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@7n5oma`} path="offical" onEnter={getLocaleLabel} component={Home}>

    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@773xh6`} path="OnlineEdit" component={OnlineEdit} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@773xh6`} path="odocSignApproval" component={OdocSignApproval} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@mpccwq`} path="AddOdocRequest" component={AddOdocRequest} />
    {/*  /main/offical/accountList?inPortal=true 公文台账显示在门户 */}
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@yvenqy`} path="accountList" component={AccountListComponent} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@8conaw`} path="center" component={CenterComponent} />
    {/* <Route path='collectionSend' component={CollectionSend} />
    <Route path='collectionReceive' component={CollectionReceive} /> */}
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@5rwcpx`} path="customPage" component={CustomTableComp} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@7wapfi`} path="docVersion" component={DocVersionComponent} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@f0noq4`} path="newTodo" component={NewTodoComp} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@8apv2d`} path="odocDone" component={OdocDoneComponent} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@q9ir7h`} path="odocFinish" component={OdocFinish} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@6ta6ef`} path="odocLibrary" component={OdocLibraryComponent} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@p689t4`} path="odocLibraryNew" component={OdocLibraryNewComponent} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@03mrek`} path="odocToView" component={ToViewComponent} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@eclsii`} path="odocViewed" component={ToViedComponent} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@tb5t37`} path="openModel" component={OpenModelCompenent} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@uzbol5`} path="docTemplate" component={DocTemplateComponent} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@bheej2`} path="odocSignGroupPage" component={OdocSignGroupPageComponent} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@5rboe0`} path="privateGroupSeting" component={privateGroupSetingComponent} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@v5oglm`} path="ReceiveDoc" component={ReceiveDoc} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@h1cbe3`} path="receiveDocManage" component={ReceiveDocManageComp} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@8whfvz`} path="recPostUnit" component={RecPostDocUnitComponent} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@ioas9w`} path="registDoc" component={ReceiveDocRegistComp} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@mdea7h`} path="report" component={ReportComponent} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@h9263n`} path="searchReq" component={SearchReqComponent} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@f31zw0`} path="sendDoc" component={SendDoc} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@elhg1s`} path="sendDocManage" component={SendDocManageComp} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@54t7ek`} path="signDocManage" component={SignDocManageComp} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@7hrx1s`} path="supervise" component={SuperviseComponent} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@ijkb1f`} path="todo" component={TodoComponent} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@r2w1xu`} path="trackingWF" component={TrackingWorkflowComp} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@bfcz6q`} path="UploadFile" component={UploadFileComponent} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@n3vvt3`} path="odocPrintMould" component={OdocPrintMould} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@9weark`} path="portalElement" component={PortalElement} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@j9zb7w`} path="quickEntryElement" component={QuickEntryElementComp} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@net68f`} path="odocTypeDialogCom" component={OdocTypeDialogCom} />


    {/* 公文中心拆分 */}
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@uj4hd9`} path="odocCenter">
      <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@swkir1`} path="layoutLeftTop" component={LayoutLeftTopComp} />
      <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@43n1um`} path="layoutLeftOdocType" component={LayoutLeftOdocTypeComp} />
      <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@3uhfnu`} path="layoutLeftTopicType" component={LayoutLeftTopicTypeComp} />
      <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@idosas`} path="layoutRightSearch" component={LayoutRightSearchComp} />
      <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@9smxhc`} path="layoutRightLibrary" component={LayoutRightLibraryComp} />
      <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@uqzfav`} path="layoutRightTodo" component={LayoutRightTodoComp} />
      <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@fbdxsl`} path="LayoutRightToView" component={LayoutRightToViewComp} />
    </Route>

    {/* 公文报表页面渲染任意报表 */}
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@h6ekth`} path="odocReport" breadcrumbName="公文报表根路由">
      {/* id = propose 拟办 post 发文 receive 收文  sign 签报  */}
      <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@kmzjjj`} path="flowChart/:id" component={FlowChartComponent} />
      {/* id = variety 公文种类 classify 主题分类统计  monthly 月度公文 */}
      <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@f8kx4h`} path="odocCount/:id" component={OdocCountEchartsComp} />
    </Route>

    {/* 门户渲染任意页面 */}
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@2c0h05`} path="odocPortal" breadcrumbName="公文门户跟路由">
      {/* id = 1 发文管理 2 收文管理 3 签报管理  /main/offical/odocPortal/odocWFManage/id  */}
      <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@j8m8n3`} path="odocWFManage/:id" component={OdocPortalOdocLibComp} />
      {/* id = 1 公文库  /main/offical/odocPortal/odocLibrary/id   */}
      <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@z998el`} path="odocLibrary/:id" component={OdocPortalOdocWFComp} />
    </Route>

  </Route>
);


module.exports = {
  Route: Routes,
  store: stores,
  components: {
    uploadFileComp: <UploadFileComponent ecId={`${this && this.props && this.props.ecId || ''}_UploadFileComponent@jdo7dg`} />,
    ...exportsComp,
      progressComponent:<ProgressComponent></ProgressComponent>,
      ofdNumberListCom:<OfdNumberListCom></OfdNumberListCom>,
    UploadDocFile: <UploadDocFile ecId={`${this && this.props && this.props.ecId || ''}_UploadDocFile@juaui7`} />,
    OpenModel: <OpenModelCompenent ecId={`${this && this.props && this.props.ecId || ''}_OpenModelCompenent@a7jjhz`} />,
    OdocTemplatePreview: <DocTemplateComponent ecId={`${this && this.props && this.props.ecId || ''}_DocTemplateComponent@xfwcws`} />,
    OdocComps2Export: <OdocComps2Export ecId={`${this && this.props && this.props.ecId || ''}_OdocComps2Export@0a2i1x`} />,
    OdocComsDialogTypes,
    OdocEvent: new OdocEvent(),
  },
};

